<?php

namespace Sharks\Core\Path;

/**
 * 模块内的访问目录
 */
class ModulePathKit {

    protected $root;
    protected $http;
    protected $model;
    protected $resource;
    protected $command;
    protected $view;

    public function __construct($modulePath) {
        $this->root = $modulePath;
        $this->http = "$modulePath/Http";
        $this->model = "$modulePath/Model";
        $this->resource = "$modulePath/Resource";
        $this->command = "$modulePath/Command";
        $this->view = "$modulePath/Views";
    }

    public function __get($name) {
        if (in_array($name, array('root', 'http', 'model', 'resource', 'command', 'view'))) {
            return $this->$name;
        }
        return new Object;
    }

}